package com.kaifamiao.lambda;

public class MissileTest {

    public static void main(String[] args) {
        /*
        MissileBuilder builder = new MissileBuilder() {
            @Override
            public Missile build(Integer id, String name) {
                Missile m = new Missile( id , name );
                return m;
            }
        };
        */

        // MissileBuilder builder = (id, name) -> new Missile( id , name );
        MissileBuilder  builder = Missile::new;
        System.out.println( builder );

        Missile m = builder.build( 1001, "东风" );
        System.out.println( m );
        m.fire();

    }

}
